<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 嵌套数组生成器 -->
    <script>
      var inorderTraversal = function* (arr) {
        let list = arr.flat(Number.MAX_VALUE)
        let index = 0
        while (index < list.length) {
          // yield { value: list[index++], done: false };
          yield list[index++]
        }
        // return { value: undefined, done: true };
        return
      }
      console.log(inorderTraversal([[[6]], [1, 3], []]))
    </script>
  </body>
</html>
